Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clean up parser comments #15252

Merged
merged 3 commits into from Dec 15, 2022
Merged

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Dec 6, 2022

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT
  1. Many JSDOC comments are broken or inconsistent with the real code, I delete those useless type declarations
  2. Fixed some internal typos
  3. Deleted several useless TODOs

@babel-bot
Copy link
Collaborator

babel-bot commented Dec 6, 2022

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/53653/

leadingNode: Node | null;
trailingNode: Node | null;
containingNode: Node | null;
start: number; // the start of the whitespace token.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit, but if we use jsdoc-like comments editors will show the as the description in autocompletion:

  /**
   * The start of the whitespace token.
   */
  start: number;

even if probably comments for start/end/comments are not needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried that but it doesn't seem to work.😕
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should work when overing over start:

image

Comment on lines 209 to 211
* ↓↓↓ We had escaped "\/" to "\\/" for comments
* For example, when parsing *\/
* // async /* 1 *\/ function f() {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually prefer the old comment style, so that it didn't need escapes 😛

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
I also hate escaping, but the old ones are.😭

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you try if JLHwung@6eee6d0 works? I added U+200B between * and /.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow this is awesome, thank you!

@nicolo-ribaudo nicolo-ribaudo merged commit 1203f18 into babel:main Dec 15, 2022
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Mar 17, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants